package com.ccys.cms.service.productAndService.impl;

import com.ccys.cms.service.productAndService.ProductListService;
import com.ccys.common.vo.ResponseResult;
import com.ccys.db.dto.web.productAndService.ProductListDto;
import com.ccys.db.entity.TblProductList;
import com.ccys.db.mapper.TblProductListMapper;
import com.ccys.db.page.PageDto;
import com.ccys.db.rely.service.impl.BaseServiceImpl;
import com.ccys.db.vo.web.productAndService.ProductListVo;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ProductListServiceImpl extends BaseServiceImpl<TblProductList> implements ProductListService {

    @Resource
    private TblProductListMapper mapper;

    @Override
    public ResponseResult<PageInfo<ProductListVo>, Object> getPage(ProductListDto dto) {
        PageDto.startPage();
        List<ProductListVo> list = mapper.getList(dto);
        PageInfo<ProductListVo> info = new PageInfo<>(list);
        return ResponseResult.success(info);
    }

}
